<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('考生信息查询列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>报考id：</label>
                                <input type="text" name="applicationId"/>
                            </li>
                            <li>
                                <label>数据来源：</label>
                                <input type="text" name="source"/>
                            </li>
                            <li>
                                <label>准考证号：</label>
                                <input th:value="${examId}" type="text" name="examId"/>
                            </li>
                            <li>
                                <label>姓名：</label>
                                <input type="text" name="name"/>
                            </li>
                            <li>
                                <label>性别：</label>
                                <input type="text" name="gender"/>
                            </li>
                            <li>
                                报考年份：
                                <select name="years" th:with="type=${@dict.getType('application_years')}" required>
                                    <option th:each="dict : ${type}"
                                            th:text="${dict.dictLabel}"
                                            th:value="${dict.dictValue}"
                                            th:attr="selected=${dict.dictValue == years} ? 'selected' : null">
                                    </option>
                                </select>
                            </li>
                            <li>
                                <label>身份证号码：</label>
                                <input type="text" name="idCardNumber"/>
                            </li>
                            <li>
                                <label>报考专业：</label>
                                <input type="text" name="major"/>
                            </li>
                            <li>
                                <label>科次名称：</label>
                                <input type="text" name="examSession"/>
                            </li>
                            <li>
                                <label>助学单位代码：</label>
                                <input type="text" name="assistantUnitCode"/>
                            </li>
                            <li>
                                <label>助学单位1：</label>
                                <input type="text" name="assistantUnit1"/>
                            </li>
                            <li>
                                <label>助学单位2：</label>
                                <input type="text" name="assistantUnit2"/>
                            </li>
                            <li>
                                <label>助学单位教师：</label>
                                <input type="text" name="teacherName"/>
                            </li>
                            <li>
                                <label>报考地区：</label>
                                <input type="text" name="applicationArea"/>
                            </li>
                            <li>
                                <label>校系统联系方式1：</label>
                                <input type="text" name="schoolContact1"/>
                            </li>
                            <li>
                                <label>校系统联系方式2：</label>
                                <input type="text" name="schoolContact2"/>
                            </li>
                            <li>
                                <label>校系统联系方式3：</label>
                                <input type="text" name="schoolContact3"/>
                            </li>
                            <li>
                                <label>校系统邮箱1：</label>
                                <input type="text" name="schoolEmail1"/>
                            </li>
                            <li>
                                <label>校系统邮箱2：</label>
                                <input type="text" name="schoolEmail2"/>
                            </li>
                            <li>
                                <label>基础1id：</label>
                                <input type="text" name="courseId"/>
                            </li>
                            <li>
                                <label>基础2id：</label>
                                <input type="text" name="contactId"/>
                            </li>

                            <li>
                                <label>省系统联系方式：</label>
                                <input type="text" name="phoneNumber"/>
                            </li>
                            <li>
                                成绩类型：
                                <select name="subjectType" th:with="type=${@dict.getType('subject_type')}" required>
                                    <option th:each="dict : ${type}"
                                            th:text="${dict.dictLabel}"
                                            th:value="${dict.dictValue}"
                                            th:attr="selected=${dict.dictValue == subjectType} ? 'selected' : null">
                                    </option>
                                </select>
                            </li>
<!--                            <li>-->
<!--                                <label>省系统邮箱：</label>-->
<!--                                <input type="text" name="email"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>专业名称：</label>-->
<!--                                <input type="text" name="majorName"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>姓名：</label>-->
<!--                                <input type="text" name="studentName"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>科次代码：</label>-->
<!--                                <input type="text" name="subjectCode"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>科次名称：</label>-->
<!--                                <input type="text" name="resultsSubjectName"/>-->
<!--                            </li>-->
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:VApplicationInfoScore:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:VApplicationInfoScore:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:VApplicationInfoScore:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:VApplicationInfoScore:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:VApplicationInfoScore:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:VApplicationInfoScore:remove')}]];
        var prefix = ctx + "system/VApplicationInfoScore";
        var vSumprefix = ctx + "system/VSumApplicationResult";
        var datas = [[${@dict.getType('application_years')}]];

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "考生信息查询",
                columns: [{
                    checkbox: true
                },
                    {
                        field: 'source',
                        sortable: true,
                        title: '数据来源'
                    },
                {
                    field: 'applicationId',
                    sortable: true,
                    title: '报考id'
                },
                {
                    field: 'examId',
                    sortable: true,
                    title: '准考证号'
                },
                {
                    field: 'name',
                    sortable: true,
                    title: '姓名'
                },
                {
                    field: 'gender',
                    sortable: true,
                    title: '性别'
                },
                {
                    field: 'years',
                    sortable: true,
                    title: '报考年份',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(datas, value);
                    }
                },
                {
                    field: 'idCardNumber',
                    sortable: true,
                    title: '身份证号码',
                    formatter: function (value, row, index) {
                        return '<a href="javascript:void(0)" onclick="viewByIdCardNumber(\'' + row.idCardNumber + '\',\'' + row.examId + '\')">' + value + '</a>';
                    }
                },
                {
                    field: 'major',
                    sortable: true,
                    title: '报考专业'
                },
                {
                    field: 'examSession',
                    sortable: true,
                    title: '科次名称'
                },
                {
                    field: 'assistantUnitCode',
                    title: '助学单位代码',
                    visible: false
                },
                {
                    field: 'assistantUnit1',
                    title: '助学单位1',
                    visible: false
                },
                {
                    field: 'assistantUnit2',
                    title: '助学单位2',
                    visible: false
                },
                {
                    field: 'teacherName',
                    title: '助学单位教师',
                    visible: false
                },
                {
                    field: 'applicationArea',
                    sortable: true,
                    title: '报考地区'
                },
                {
                    field: 'schoolContact1',
                    title: '校系统联系方式1',
                    visible: false
                },
                {
                    field: 'schoolContact2',
                    title: '校系统联系方式2',
                    visible: false
                },
                {
                    field: 'schoolContact3',
                    title: '校系统联系方式3',
                    visible: false
                },
                {
                    field: 'schoolEmail1',
                    title: '校系统邮箱1',
                    visible: false
                },
                {
                    field: 'schoolEmail2',
                    title: '校系统邮箱2',
                    visible: false
                },
                {
                    field: 'courseId',
                    sortable: true,
                    title: '基础1id'
                },
                {
                    field: 'score',
                    sortable: true,
                    title: '考试成绩'
                },
                    {
                        field: 'contactId',
                        sortable: true,
                        title: '基础2id'
                    },
                // {
                //     field: 'phoneNumber',
                //     title: '省系统联系方式'
                // },
                // {
                //     field: 'email',
                //     title: '省系统邮箱'
                // },
                // {
                //     field: 'majorName',
                //     title: '专业名称'
                // },
                // {
                //     field: 'studentName',
                //     title: '姓名'
                // },
                // {
                //     field: 'subjectCode',
                //     title: '科次代码'
                // },
                // {
                //     field: 'resultsSubjectName',
                //     title: '科次名称'
                // },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.applicationId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.applicationId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
        /*考试详细*/
        function viewByIdCardNumber(idCardNumber,examId) {
            var url = vSumprefix + '/view/' + idCardNumber;
            $.modal.openTab("考生成绩信息汇总详情", url);
        }
    </script>
</body>
</html>